<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title> test ppp charge </title>
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">

	</head>

	<body>

	</body>
</html>

<script type="text/javascript" src="http://cdn.bootcss.com/zepto/1.1.4/zepto.min.js"></script>
<script type="text/javascript" src="js/pingpp_pay.js"></script>

<script type="text/javascript">
$(function(){
	$.get('/yn/charge', function(data){
		data.channel = 'wx_pub';
		data.credential = JSON.parse(data.credential);
		data.credential.wx_pub = data.credential.wx;

		pingpp.createPayment(data, function(result, err){
			if(result == 'success'){
				console.log('ok');
			}else{
				console.log(result + ' ' + err.msg + ' ' + err.extra);
			}
		});
	});
});
</script>